<?php

declare (strict_types=1);
namespace DbModels\RBAC;

/**
 * @property int $id
 * @property string $name
 * @property string $display_name
 * @property int $state
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 */
class Role extends \App\Abstract\Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected ?string $table = 'rbac_roles';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = ['id' => 'integer', 'state' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function permissionid()
    {
        return $this->hasMany(RolePermission::class,'role_id','id');
    }
}
